// 统一管理接口地址
import request from "@/request/request"
// 定义对应的接口
// 精品推荐接口
export const JingPinAPI =()=>request.get('/products/recommend')

// 热门兑换
export const ReMenAPI =()=>request.get('/products/hot')
import qs from "qs"
// 发送短信验证码请求
export const SendSMSAPI = params => request.post("/sendSMS",qs.stringify(params));

// 手机号登录请求
export const PhoneLoginAPI = params => request.post("/phoneRegin",qs.stringify(params));

// 微信登录（这个接口必须用qs对数据进行格式化）
export const WeixinLoginApi = (params) => request.post(`/wechatUsers/PCLogin`, qs.stringify(params));

//手机绑定微信请求
export const BindPhoneAPI = (params) => request.post(`/wechatUsers/binding`,qs.stringify(params));

// 获取登录用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles");

// 首页精品推荐请求
export const JingpinAPI = () => request.get("/products/recommend");
// 请求热门兑换的数据
export const RemenAPI = () => request.get("/products/hot");

// 请求详情页的数据
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);

// 加入到购物车
export const AddToCartAPI = (params) => request.post(`/shop/carts/add`, qs.stringify(params));

// 商品搜索（含首页的“更多”）
export const GoodsSearchAPI = (params) => request.get(`/products`, {params});


// 请求购物车数据
export const CartDataAPI = () => request.get(`/shop/carts`);

